package Tela;

import java.awt.Dimension;
import java.awt.GridLayout;
import java.util.ArrayList;
import javax.swing.JPanel;

/**
 *
 * @author Douglas
 */
public class Painel extends JPanel {

    int lin;
    int col;
    Pixel listaPixel[][];

    public Painel(int lin, int col) {
        this.lin = lin;
        this.col = col;
        this.setLayout(new GridLayout(lin, col, 1, 1));
        listaPixel = new Pixel[lin][col];
        for (int i = 0; i < lin; i++) {
            for (int j = 0; j < col; j++) {
                listaPixel[i][j] = createPixel(i, j);
                this.add(listaPixel[i][j]);
            }
        }
    }

    private Pixel createPixel(int i, int j) {
        Pixel p = new Pixel();
        p.setSize(new Dimension(5, 5));
        return p;
    }
    
    public Pixel[][] getLista(){
        return this.listaPixel;
    }
}
